include_directories (
	${CMAKE_SOURCE_DIR}/src/util
	${OPENGL_INCLUDE_PATH}
	${GLUT_INCLUDE_DIR}
	${GLEW_INCLUDE_DIR}
)

link_directories (
	${CMAKE_SOURCE_DIR}/src/util
)

link_libraries (
	util
	${OPENGL_gl_LIBRARY}
	${OPENGL_glu_LIBRARY}
	${GLUT_glut_LIBRARY}
	${GLEW_glew_LIBRARY}
)

set (subdir trivial)

set (targets
	clear-color
	clear-fbo
	clear-fbo-scissor
	clear-fbo-tex
	clear-random
	clear-repeat
	clear-scissor
	clear-undefined
	createwin
	dlist-begin-call-end
	dlist-dangling
	dlist-degenerate
	dlist-edgeflag
	dlist-edgeflag-dangling
	dlist-flat-tri
	dlist-mat-tri
	dlist-recursive-call
	dlist-tri-flat-tri
	dlist-tri-mat-tri
	draw2arrays
	drawarrays
	drawelements
	drawelements-large
	drawrange
	flat-clip
	fs-tri
	line
	line-clip
	line-cull
	line-flat
	lineloop
	lineloop-clip
	lineloop-elts
	line-smooth
	line-stipple-wide
	linestrip
	linestrip-clip
	linestrip-flat-stipple
	linestrip-stipple
	linestrip-stipple-wide
	line-userclip
	line-userclip-clip
	line-userclip-nop
	line-userclip-nop-clip
	line-wide
	line-xor
	long-fixed-func
	pgon-mode
	point
	point-clip
	point-param
	point-sprite
	point-wide
	point-wide-smooth
	poly
	poly-flat
	poly-flat-clip
	poly-flat-unfilled-clip
	poly-unfilled
	quad
	quad-clip-all-vertices
	quad-clip
	quad-clip-nearplane
	quad-degenerate
	quad-flat
	quad-offset-factor
	quad-offset-unfilled
	quad-offset-units
	quads
	quadstrip
	quadstrip-clip
	quadstrip-cont
	quadstrip-flat
	quad-tex-2d
	quad-tex-3d
	quad-tex-alpha
	quad-tex-pbo
	quad-tex-sub
	quad-unfilled
	quad-unfilled-clip
	quad-unfilled-stipple
	readpixels
	sub-tex
	tex-quads
	tri-2101010
	tri-2101010-dlist
	tri-alpha
	tri-alpha-tex
	tri-array-interleaved
	tri-blend
	tri-blend-color
	tri-blend-max
	tri-blend-min
	tri-blend-revsub
	tri-blend-sub
	tri
	tri-clear
	tri-clip
	tri-cull-both
	tri-cull
	tri-dlist
	tri-edgeflag
	tri-edgeflag-array
	tri-edgeflag-pv
	trifan
	trifan-flat
	trifan-flat-clip
	trifan-flat-unfilled-clip
	trifan-unfilled
	tri-fbo
	tri-fbo-tex
	tri-fbo-tex-mip
	tri-flat
	tri-flat-clip
	tri-fog
	tri-fp
	tri-fp-const-imm
	tri-lit
	tri-lit-material
	tri-logicop-none
	tri-logicop-xor
	tri-mask-tri
	tri-multitex-vbo
	tri-orig
	tri-point-line-clipped
	tri-query
	tri-repeat
	tri-scissor-tri
	tri-square
	tri-stencil
	tri-stipple
	tristrip
	tristrip-clip
	tristrip-flat
	tri-tex-1d
	tri-tex-3d
	tri-tex
	tri-tri
	tri-unfilled
	tri-unfilled-clip
	tri-unfilled-edgeflag
	tri-unfilled-fog
	tri-unfilled-point
	tri-unfilled-smooth
	tri-unfilled-tri
	tri-unfilled-tri-lit
	tri-unfilled-userclip
	tri-unfilled-userclip-stip
	tri-userclip
	tri-viewport
	tri-z-9
	tri-z
	tri-z-eq
	vbo-drawarrays
	vbo-drawarrays-2101010
	vbo-drawelements
	vbo-drawrange
	vbo-noninterleaved
	vbo-tri
	vp-array
	vp-array-hf
	vp-array-int
	vp-clip
	vp-line-clip
	vp-tri
	vp-tri-cb
	vp-tri-cb-pos
	vp-tri-cb-tex
	vp-tri-imm
	vp-tri-invariant
	vp-tri-swap
	vp-tri-tex
	vp-unfilled
)

foreach (target ${targets})
	add_executable (${subdir}_${target} ${target}.c)
	set_target_properties (${subdir}_${target} PROPERTIES OUTPUT_NAME ${target})
	install (TARGETS ${subdir}_${target} DESTINATION ${subdir})
endforeach (target)
